package com.web.shop.service.impl;

import com.web.shop.document.EsItem;
import com.web.shop.repository.EsItemRepository;
import com.web.shop.service.EsItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

@Service
public class EsItemServiceImpl implements EsItemService {
    @Autowired
    private EsItemRepository esItemRepository;
    @Override
    public Page<EsItem> queryEsItem(String key, Pageable pageable) {
        return esItemRepository.findItemByPrefixKeyword(key,pageable);
    }

    @Override
    public EsItem findEsItemById(Long goods_id) {
        return esItemRepository.findById(goods_id).get();
    }
}
